<!DOCTYPE html>
<html>
    <head>
        <base target="_self">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0 , maximum-scale=1.0, user-scalable=0">
        <title>[测试投票]性感美女</title>
        <meta name="format-detection" content="telephone=no"/>
        <meta name="apple-mobile-web-app-capable" content="yes"/>
        <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
        <link href="style/touch.css" rel="stylesheet" type="text/css"/>
        <script src="style/jquery.js" type="text/javascript"></script>
        <script src="style/jquery.grid-a-licious.min.js" type="text/javascript"></script>
    </head>
    <body>
        <section class="top_box clearfix">
            <img src="style/common_469_pEILDPkE.jpg" />
        </section>
        <section class="phb_box clearfix">
            <div class="phb_box_table clearfix">
                <table cellpadding="0" cellspacing="0" >
                    <thead>
                        <tr style="background-color: #09ACDB;">
                            <th>排行</th>
                            <th>姓名</th>
                            <th>投票数</th>
                        </tr>
                    </thead>
                    <tbody id="table">

                    </tbody>
                </table>
            </div>
        </section>
        <!-- footer start-->
        <section class="footer_block clearfix "></section>
        <footer class="footer_main clearfix">
            <link rel="stylesheet" type="text/css" href="style/daohang.css">
            <div class="bot_main">
                <ul>
                    <li class="ico_1"><a href="index.html"><span class="ico"><img src="style/i1.png" /></span><span class="txt">首页</span></a></li>
                    <li class="ico_3"><a href="applay.html"><span class="ico"><img src="style/i2.png" /></span><span class="txt">报名</span></a></li>
                    <li class="ico_2"><a href="ranking.html"><span class="ico"><img src="style/i3.png" /></span><span class="txt">排名</span></a></li>
                    <li class="ico_4"><a href="http://mp.weixin.qq.com/s?__biz=MzAxNzUzMjA3NA==&tempkey=9QqH4VjlxGVBDx09OjjMT%2FkXPl6902NysC3KFsKWhZ%2FhZmbtUjPOVqq5ieLEOzgf%2BvFJyv7MaUqu%2BH%2BhcO6GCIBCk0pcmwqGu3TW%2FiDdzvCoQOjUDmRSRSxJTXMhTQvJbegNVNswu7BFQ626t3GkJQ%3D%3D&#rd"><span class="ico"><img src="style/i4.png" /></span><span class="txt">自定义</span></a></li>
                </ul>
            </div>
        </footer>
        <!-- footer end-->
    </body>
    <script type="text/javascript">
        $(document).ready(function() {
            //debugger;
            //排名
            $.ajax({
                type: "GET",
                url: "ajax.php?action=ranking",
                dataType: "json",
                success: function(data) {
                    if (data) {
                        var x = 1;
                        var trHTML = "";
                        var clse = "";
                        $.each(data, function(i, item) {
                            if (x % 2) {
                                clse = "";
                            } else {
                                clse = "two";
                            }
                            if (x <= 3) {
                                trHTML = "<tr class='" + clse + " top'><td ><span>" + x
                                        + "</span></td><td><font color=\"#0099CC\">" + item.id + "号</font>&nbsp; " + item.name
                                        + "</td><td><b style='color:red'>" + item.vote + "</b></td></tr>";
                            } else {
                                trHTML = "<tr class='" + clse + "'><td ><span>" + x
                                        + "</span></td><td><font color=\"#0099CC\">" + item.id + "号</font>&nbsp; " + item.name
                                        + "</td><td>" + item.vote + "</td></tr>";
                            }
                            $("#table").append(trHTML);
                            x++;
                        });
                    }
                }
            });
        });
    </script>
</html>

